import { defineStore } from "pinia";

export const modalControllers = defineStore("modal", {
  state: () => ({
    popups: {
      questionBankModal: false,
      addCourseModal: false,
      editCourseModal: false,
      editUserModal: false,
      editPlantModal: false,
      editRoleModal: false,
      logDetailModal: false,
      newAssessmentModal: false,
      newPlantModal: false,
      newRoleModal: false,
      newUserModal: false,
      roleManagementModal: false,
      rolePermissionModal: false,
      templateModal: false,
      viewPlanModal: false,
      errorReportModal: false,
      submitConfirmModal: false,
      filterModal: false,
      newPlanModal: false,
      editAssessmentModal: false, 
    },
  }),
  actions: {
    togglePopup(popupName) {
      this.popups[popupName] = !this.popups[popupName];
    },
    openPopup(popupName) {
      this.popups[popupName] = true;
    },
    closePopup(popupName) {
      this.popups[popupName] = false;
    },
  },
});
